#include<stdio.h>
int main()
{
    //freopen("in.txt","r",stdin);
    int s,v;
    scanf("%d %d",&s,&v);
    int HH = 7;
    int MM = 50;
    int min = s/v;
    int k = 0;
    if(s%v) k = 1;
    while(MM - min -k < 0)
    {
        HH--;
        if(HH < 0) HH = HH+24;
        MM+=60;
    }
    printf("%02d:%02d",HH,MM-min-k);
}